package util.AST.Comand;

import java.util.ArrayList;

import checker.SemanticException;
import checker.Visitor;

import util.AST.Statement.Statement;
import util.AST.Terminal.ID;
import util.AST.Terminal.Tipo;

public class FunctionDeclaration extends Comand{

	private ID name;
	private Tipo type;
	private ArrayList<VarDeclaration> args;
    private ArrayList<VarDeclaration> newVars;
    private ArrayList<Statement> statements;
    private ArrayList<VarDeclaration> parameters;
    
	public FunctionDeclaration(ID name, Tipo type,
			ArrayList<VarDeclaration> args, ArrayList<VarDeclaration> newVars,
			ArrayList<Statement> statements) {
		this.name = name;
		this.type = type;
		this.args = args;
		this.newVars = newVars;
		this.statements = statements;
	}
	
	public FunctionDeclaration(ID name, Tipo type,
		ArrayList<VarDeclaration> newVars,
			ArrayList<Statement> statements) {
		this.name = name;
		this.type = type;
		this.newVars = newVars;
		this.statements = statements;
	}

	public ID getName() {
		return name;
	}

	public Tipo getType() {
		return type;
	}

	public ArrayList<VarDeclaration> getArgs() {
		return args;
	}

	public ArrayList<VarDeclaration> getNewVars() {
		return newVars;
	}
	 public ArrayList<VarDeclaration> getParameters() {
         return parameters;
 }


	public ArrayList<Statement> getStatements() {
		return statements;
	}

	@Override
	public String toString(int level) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object visit(Visitor v, Object o) throws SemanticException {
		// TODO Auto-generated method stub
		return v.visitFunctionDeclaration(this, o);
	}

}
